home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / fs / super.h < prev    next >
Text File  |  1990-07-23  |  2KB  |  44 lines

  1. /* Super block table.  The root file system and every mounted file system
  2.  * has an entry here.  The entry holds information about the sizes of the bit
  3.  * maps and inodes.  The s_ninodes field gives the number of inodes available
  4.  * for files and directories, including the root directory.  Inode 0 is 
  5.  * on the disk, but not used.  Thus s_ninodes = 4 means that 5 bits will be
  6.  * used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
  7.  * for files and directories.  The disk layout is:
  8.  *
  9.  *      Item        # blocks
  10.  *    boot block      1
  11.  *    super block     1
  12.  *    inode map     s_imap_blocks
  13.  *    zone map      s_zmap_blocks
  14.  *    inodes        (s_ninodes + 1 + INODES_PER_BLOCK - 1)/INODES_PER_BLOCK
  15.  *    unused        whatever is needed to fill out the current zone
  16.  *    data zones    (s_nzones - s_firstdatazone) << s_log_zone_size
  17.  *
  18.  * A super_block slot is free if s_dev == NO_DEV. 
  19.  */
  20.  
  21.  
  22. EXTERN struct super_block {
  23.   ino_t s_ninodes;        /* # usable inodes on the minor device */
  24.   zone_nr s_nzones;        /* total device size, including bit maps etc */
  25.   unshort s_imap_blocks;    /* # of blocks used by inode bit map */
  26.   unshort s_zmap_blocks;    /* # of blocks used by zone bit map */
  27.   zone_nr s_firstdatazone;    /* number of first data zone */
  28.   short int s_log_zone_size;    /* log2 of blocks/zone */
  29.   off_t s_max_size;        /* maximum file size on this device */
  30.   short s_magic;        /* magic number to recognize super-blocks */
  31.  
  32.   /* The following items are only used when the super_block is in memory. */
  33.   struct buf *s_imap[I_MAP_SLOTS]; /* pointers to the in-core inode bit map */
  34.   struct buf *s_zmap[ZMAP_SLOTS]; /* pointers to the in-core zone bit map */
  35.   dev_t s_dev;            /* whose super block is this? */
  36.   struct inode *s_isup;        /* inode for root dir of mounted file sys */
  37.   struct inode *s_imount;    /* inode mounted on */
  38.   time_t s_time;        /* time of last update */
  39.   char s_rd_only;        /* set to 1 iff file sys mounted read only */
  40.   char s_dirt;            /* CLEAN or DIRTY */
  41. } super_block[NR_SUPERS];
  42.  
  43. #define NIL_SUPER (struct super_block *) 0
  44.